package com.ccjk.beusoft.hot.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by CCJK on 2018/11/17.
 */

public class LifeCycle extends Fragment {
    private static final String TAG = "Fragment Lifecycle";

    @Override
    public void onStart() {
        super.onStart();
//        Log.e(TAG, "Fragment start");


    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        getChildFragmentManager().beginTransaction().add(new FragmentLifeCycle(),"lifeCycle").commit();
    }



    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        TextView textView=new TextView(container.getContext());
        textView.setText("fragment");


        return textView;
    }

    @Override
    public void onStop() {
        super.onStop();
//        Log.e(TAG, "Fragment stop");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
//        Log.e(TAG, "Fragment destroy");
    }
}
